Skip to content

Respect settle queue size#4338

Merged
fafk merged 15 commits intomainfrom
respect-queue-size
Apr 16, 2026
Merged

Respect settle queue size#4338
fafk merged 15 commits intomainfrom
respect-queue-size

Conversation

@fafk
Copy link
Copy Markdown
Contributor

@fafk fafk commented Apr 15, 2026

Description

The reference driver rejects new solutions when there is already a backlog of solutions that still need to be submitted because they will most likely not be mined in time. This is intended to protect very competitive solvers from penalties when they win too much but can't submit fast enough.
#4167 introduced a bug where the check whether to reject the /solve request only looks at the available tx submission slots but not the settle queue.
This has the consequence that a solver with only a single submission EOA that won an auction will reject /solve requests until the previous solution was submitted.

Changes

Add a semaphore with capacity equal to queue size to mimic missing queue behavior.

@fafk fafk closed this Apr 15, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2026
@fafk fafk reopened this Apr 15, 2026
@fafk fafk marked this pull request as ready for review April 16, 2026 05:45
@fafk fafk requested a review from a team as a code owner April 16, 2026 05:45
@cowprotocol cowprotocol unlocked this conversation Apr 16, 2026
Comment thread crates/driver/src/domain/competition/mod.rs Outdated
Comment thread crates/driver/src/domain/competition/mod.rs Outdated
Comment thread crates/driver/src/domain/competition/mod.rs
Comment thread crates/driver/src/domain/competition/mod.rs Outdated
Comment thread crates/driver/src/tests/cases/settle.rs Outdated
Comment thread crates/driver/src/tests/cases/settle.rs Outdated
Comment thread crates/driver/src/tests/cases/settle.rs Outdated
Comment thread crates/driver/src/domain/competition/mod.rs Outdated
@fafk fafk marked this pull request as draft April 16, 2026 11:18
@fafk fafk marked this pull request as ready for review April 16, 2026 11:19

#[tokio::test]
#[ignore]
async fn accepts_new_settle_requests_after_timeout() {
Copy link
Copy Markdown
Contributor Author

@fafk fafk Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors settlement request handling by replacing the internal mpsc queue with an admission semaphore in the SubmitterPool, allowing for buffered requests and concurrent EIP-7702 submissions. It introduces a SettleTaskHandle to manage task lifecycles with a grace period for cleanup and removes the background request processing loop in favor of direct task spawning. Tests have been updated to reflect the new semaphore-based admission logic. No critical issues were found, and I have no feedback to provide.

Copy link
Copy Markdown
Contributor

@MartinquaXD MartinquaXD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@fafk fafk added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit ea53cdc Apr 16, 2026
23 checks passed
@fafk fafk deleted the respect-queue-size branch April 16, 2026 12:10
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants